import { createMemoryHistory, createRouter } from 'vue-router'
import Book from "@/components/Book.vue";
import Login from "@/components/Login.vue";
import Register from "@/components/Register.vue";

//2、配置路由表信息
const routes = [
    {
        path: '/',   //根目录访问地址
        name: 'book',
        component: Book
    },
    {
        path: '/login',  //登录
        name: 'login',
        component: Login
    },
    {
        path: '/register',
        name: 'register',
        component: Register  //注册
    }
]

//创建路由器
const router = createRouter({
    history: createMemoryHistory(),
    routes,
})
export { router }